const mongoose = require('mongoose'); //通过mongoose去连接mongodb数据库，操作数据模型

var mongoosePaginate = require('mongoose-paginate'); //第三方插件,分页插件

var schema = new mongoose.Schema({ cateId: mongoose.Schema.ObjectId, content: String, name: String }); //schema 模式
schema.plugin(mongoosePaginate);

var Comment = mongoose.model('Comment', schema); // Model.paginate()

module.exports = Comment;
/* const User = mongoose.model('User', { name: String, password: String }); //user数据库，上传的时候会自动加一个s,再在对象中写入一个参数，即数据库的真表名
module.exports = User; */